-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds custom font size to list of sizes options #27785
Conversation
Pinging @elastic/kibana-canvas |
💔 Build Failed |
CI failure seems pretty unrelated... was this created from the latest master? Maybe a rebase will cure it? I was having problems last week that seems to have been resolved. |
💚 Build Succeeded |
Sweet, flakey tests! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Changed font size and saw it reflected in the settings panel, as described.
@@ -64,6 +64,11 @@ export const TextStylePicker = ({ | |||
['underline']: Boolean(underline), | |||
}; | |||
|
|||
if (!isNaN(size) && fontSizes.indexOf(Number(size)) === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the isNaN
check required here? Invalid values come in as NaNpx
(another bug honestly), and then the dropdown still just shows 0. This isn't really a problem (it's edge case and is caused by another problem) and I'm not sure what else it would show, but thought I'd ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue for the NaN
thing I mentioned: #27788
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice fix, I wonder if we have this problem for other drop downs too.
Closes #24936.
If you set the font size to a value not in our built in list of sizes, the value would display as
0
in the sidebar. This adds a check to add a value to the array of font sizes if the value doesn't already exist.